package org.senRPC.example.generic.test_2;

import org.senRPC.client.provider.controler.DefaultProvider;
import org.senRPC.common.exception.remoting.RemotingException;
import org.senRPC.example.demo.service.ByeServiceImpl;
import org.senRPC.example.demo.service.HelloSerivceImpl;
import org.senRPC.remoting.config.NettyClientConfig;
import org.senRPC.remoting.config.NettyServerConfig;

public class ProviderTest {

public static void main(String[] args) throws InterruptedException, RemotingException {

		DefaultProvider defaultProvider = new DefaultProvider(new NettyClientConfig(), new NettyServerConfig());


		defaultProvider.registryAddress("127.0.0.1:18010") //注册中心的地址
					   .serviceListenPort(8899) //暴露服务的地址
					   .publishService(new HelloSerivceImpl(),new ByeServiceImpl()) //暴露的服务
					   .start(); //启动服务

	}

}
